package com.stox.charting.ui.swing.event.listener;

import com.stox.charting.ui.swing.event.ChartModelChangedEvent;
import com.stox.charting.ui.swing.model.ChartModel.ChartModelListener;
import com.stox.charting.ui.swing.model.price.PriceChartModel;
import com.stox.core.model.intf.HasBars;

public class BarTypeChangedEventListener implements ChartModelListener {

	@Override
	@SuppressWarnings("unchecked")
	public void chartModelChanged(ChartModelChangedEvent event) {
		if(event.getProperty().equalsIgnoreCase("barType")){
			PriceChartModel<? extends HasBars> model = (PriceChartModel<? extends HasBars>)event.getSource();
			model.constructUiUnits();
		}
	}

}
